﻿using System.Web.Security;

namespace HashFoo.Rest.Server
{
    /// <summary>
    /// Provides forms based authentication using ASP infrastructure.
    /// </summary>
    public class AspFormsAuthenticator : IFormsAuthenticator
    {
        /// <summary>
        /// Set the forms authentication cookie.
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="isPersistent"></param>
        public void SetAuthCookie(string userName, bool isPersistent)
        {
            FormsAuthentication.SetAuthCookie(userName, isPersistent);
        }

        /// <summary>
        /// Clear the forms authentication.
        /// </summary>
        public void SignOut()
        {
            FormsAuthentication.SignOut();
        }
    }
}